package com.code.factory.utils;

import java.util.HashMap;
import java.util.Map;

public class Const {
	/**配置数据源*/
    public final static String JDBC_URL = "jdbc:oracle:thin:@10.10.100.8:1521:orcl";
	//public final static String JDBC_URL = "jdbc:mysql://192.168.14.1:3306/test";
    public final static String JDBC_USERNAME = "murp_hr";
    public final static String JDBC_PASSWORD = "murp2016";

    /**对应的原始表名数组*/
    public final static String[] GENTERATOR_TABLES = { 
    		"PJ_SUBJECT"
    	};

    /**对应的表别名数组 也是实体名,首字母大写*/
    public final static String[] GENTERATOR_TABLES_AS = {
    		"subject"
    	};
    
    /**生成文件包路径*/
    public final static String PACKAGE_SRC_ROOT = "com.murp.university.evaluation.";
    
    /**生成文件包*/
    public final static String PACKAGE_DAO = PACKAGE_SRC_ROOT + "dao";
    public final static String PACKAGE_SERVICE = PACKAGE_SRC_ROOT + "service";
    public final static String PACKAGE_SERVICE_IMPL = PACKAGE_SRC_ROOT + "serviceImpl";
    public final static String PACKAGE_POJO = PACKAGE_SRC_ROOT + "pojo";
    public final static String PACKAGE_CONFIG_ROOT = "config.";
    public final static String PACKAGE_MAPPING = PACKAGE_CONFIG_ROOT + "mapper";

    /**项目根路径*/
    public final static String PROJECT_ROOT_PATH = System.getProperty("user.dir");
    public final static String OUTPUT_DAO_PATH = PROJECT_ROOT_PATH + "/output/dao/";
    public final static String OUTPUT_MAPPING_PATH = PROJECT_ROOT_PATH + "/output/mapping/";
    public final static String OUTPUT_POJO_PATH = PROJECT_ROOT_PATH + "/output/pojo/";
    public final static String OUTPUT_SERVICE_PATH = PROJECT_ROOT_PATH + "/output/service/";
    public final static String OUTPUT_SERVICE_IMPL_PATH = PROJECT_ROOT_PATH + "/output/serviceImpl/";

    /**数据库类型与JAVA类型映射表*/
    public final static Map<String, String> DB_TO_JAVA_TYPE_MAPPING = new HashMap<String, String>();
    
    static {
        DB_TO_JAVA_TYPE_MAPPING.put("CHAR", "String");
        DB_TO_JAVA_TYPE_MAPPING.put("VARCHAR", "String");
        DB_TO_JAVA_TYPE_MAPPING.put("VARCHAR2", "String");
        DB_TO_JAVA_TYPE_MAPPING.put("NVARCHAR2", "String");
        DB_TO_JAVA_TYPE_MAPPING.put("TIMESTAMP", "Date");
        DB_TO_JAVA_TYPE_MAPPING.put("DATETIME", "Date");
        DB_TO_JAVA_TYPE_MAPPING.put("DATE", "Date");
        DB_TO_JAVA_TYPE_MAPPING.put("TIME", "Date");
        DB_TO_JAVA_TYPE_MAPPING.put("TEXT", "String");
        DB_TO_JAVA_TYPE_MAPPING.put("CLOB", "String");
        DB_TO_JAVA_TYPE_MAPPING.put("NCLOB", "String");
        DB_TO_JAVA_TYPE_MAPPING.put("MEDIUMTEXT", "String");
        DB_TO_JAVA_TYPE_MAPPING.put("BLOB", "byte[]");
        DB_TO_JAVA_TYPE_MAPPING.put("MEDIUMBLOB", "byte[]");
        DB_TO_JAVA_TYPE_MAPPING.put("INTEGER", "Integer");
        DB_TO_JAVA_TYPE_MAPPING.put("TINYINT", "Integer");
        DB_TO_JAVA_TYPE_MAPPING.put("SMALLINT", "Integer");
        DB_TO_JAVA_TYPE_MAPPING.put("MEDIUMINT", "Integer");
        DB_TO_JAVA_TYPE_MAPPING.put("LONG", "Long");
        DB_TO_JAVA_TYPE_MAPPING.put("NUMBER", "Integer");
        DB_TO_JAVA_TYPE_MAPPING.put("BIT", "boolean");
        DB_TO_JAVA_TYPE_MAPPING.put("BIGINT", "Long");
        DB_TO_JAVA_TYPE_MAPPING.put("FLOAT", "float");
    }
}
